package com.cx.service.impl;

import com.cx.mapper.AreaMapper;
import com.cx.pojo.Area;
import com.cx.service.AreaService;
import com.cx.util.SqlSessionUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class AreaServiceImpl implements AreaService {
    @Override
    public List<Area> selectByCityId(String cityId) {
        SqlSession sqlSession = SqlSessionUtil.openSqlSession();
        AreaMapper areaMapper = sqlSession.getMapper(AreaMapper.class);
        List<Area> areas = areaMapper.selectByCityId(cityId);
        sqlSession.close();
        return areas;
    }
}
